<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean"  prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@page import="com.kcs.common.utils.commonUtils"%>
<%@page import="com.kcs.common.utils.PropsUtils"%>
<%@page import="com.kcs.common.utils.Constant"%>

<html>
<head>
<title>FX Margin - Over Limit Summary Report</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.pack.js"></script>   
<script type="text/javascript" src="jsp/script/jsDatePick.full.1.3.js"></script>   	 	 	
<script type="text/javascript" src="jsp/script/common.js"></script>  
<link rel="stylesheet" type="text/css" href="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/table.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/fxmarginStyle.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/jsDatePick_ltr.css" />

<script type="text/javascript">

	function searchOverLimitSummary(){
		var tranCode = document.getElementsByName("tranCode")[0];
		tranCode.value = "searchOverLimitSummary";
		document.forms[0].submit();

		loading();
	}

	function exportOverLimitSummary(){
		var tranCode = document.getElementsByName("tranCode")[0];
		tranCode.value = "exportOverLimitSummary";
		document.forms[0].submit();
	}

	function exportOverLimitSummaryToExcel(){
		var tranCode = document.getElementsByName("tranCode")[0];
		tranCode.value = "exportOverLimitSummaryToExcel";
		document.forms[0].submit();
	}
	

</script>

</head>
<body>
	<!-- HEADER MENU -->
	<%@ include	file="include/headerMenu.jsp"%> 
	
		<center>
			<div id="overLimitSummaryReport" style="width:95%;">
				<html:form action="/OverLimitSummaryReportAction.do" style="margin:0px;">
				
					<html:hidden property="tranCode"/>
					
					<table class="MarginHeader" width="100%">
						<tr>
							<td width="100%" style="text-align:left;">
								Over Limit Summary Report
							</td>
						</tr>
					</table>
					
					<table width="100%" border="0">
						<tr>
							<td>
								<table class="MarginCriteria" width="100%">
									<tr>
										<td colspan="4">
											<center>
												<input type="button" class="button" value="Search" onclick="searchOverLimitSummary();"/>
												&nbsp;
												&nbsp;
												<logic:notEmpty name="OverLimitSummaryReportActionForm" property="overLimitSummaryList">
													<input type="button" class="button" value="Export PDF" onclick="exportOverLimitSummary();"/>
												</logic:notEmpty>
												<logic:empty name="OverLimitSummaryReportActionForm" property="overLimitSummaryList">
													<input type="button" class="button" value="Export PDF" onclick="exportOverLimitSummary();" disabled/>
												</logic:empty>
												&nbsp;
												&nbsp;
												<logic:notEmpty name="OverLimitSummaryReportActionForm" property="overLimitSummaryList">
													<input type="button" class="button" value="Export Excel" onclick="exportOverLimitSummaryToExcel();"/>
												</logic:notEmpty>
												<logic:empty name="OverLimitSummaryReportActionForm" property="overLimitSummaryList">
													<input type="button" class="button" value="Export Excel" onclick="exportOverLimitSummaryToExcel();" disabled/>
												</logic:empty>
											</center>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						
						<tr>
							<td colspan="4" align="center">
								<br/><br/>
								<font size="3"><b>KRUNG THAI BANK PLC.</b></font>
							</td>
						</tr>
						
						<tr>
							<td colspan="4" align="center">
								<font size="2"><b>Over Limit Summary Report (Corporate)</b></font>
							</td>
						</tr>
						
						<tr>
							<td>
								<br/>
								<center>
									<%
										Object err = request.getAttribute(Constant.ERR_ATTR);
									
										if(err != null){
											%>
												<script type="text/javascript">
													alert("<%=err%>");
												</script>
											<%
										}else{
											%>
												<logic:present name="<%=Constant.SHOW_RESULT%>">
													<div class="MarginTable" >
														<display:table id="data" name="sessionScope.OverLimitSummaryReportActionForm.overLimitSummaryList" requestURI="/OverLimitSummaryReportAction.do" pagesize="10" >
															<display:column property="rowNum" title="No" sortable="false" style="text-align:center;"/>
															<display:column property="accountName" title="Account Name"   sortable="false" style="text-align:left;"/>
															<display:column property="limitType" title="Limit Type" sortable="false" style="text-align:center;"/>			
															<display:column property="totalLimit" title="Total Limit" sortable="false" style="text-align:right;"/>
															<display:column property="totalUsed" title="Total Used" sortable="false" style="text-align:right;"/>
															<display:column property="available" title="Available" sortable="false" style="text-align:right;"/>
															<display:column property="utilization" title="%Utilization" sortable="false" style="text-align:right;"/>
														</display:table>
													</div>
													
												</logic:present>
										<%}%>
								</center>			
							</td>
						</tr>
					</table>
				
					<div style="display:none">
				        <div id="popupCustomer" style="width:710px;height: 600px">
				        	<div id="popupCustomer_iframe"></div>
							<table width="100%">
								<tr>
									<td width="33%" align="center">
										<input type="button" value="Ok" class="button" onclick="onCustomer();"/>
									</td>
									<td width="34%" align="center">
										<input type="button" value="Close" class="button" onclick="offCustomer();"/>
									</td>
								</tr>
							</table>
				        </div>
				    </div>
					<%@ include	file="include/footer.jsp"%> 	
					<%@ include	file="include/message.jsp"%> 

				</html:form>
			
			</div>
		</center>
</body>
</html>